package SalarySystem;

import java.util.*;
public class Salary{
    public  float Rate(float money){
            final  int[] moneyscope={0,5000,8000,17000,30000,40000,60000,85000,1000000000},rate={0,3,10,20,25,30,35,45};
            float ratemoney=0,residue=0;

            for(int i=0;i<8;i++){
                if(moneyscope[i]<money&&money<=moneyscope[i+1])
                {
                    residue=money-moneyscope[i];
                    ratemoney+=residue*(1-rate[i+1]/100.0);
                    break;
                }
                ratemoney+=moneyscope[i+1]*(1-rate[i+1]/100.0);

            }
                return ratemoney;
            }



}

